home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / program / txtlblmg.lha / TextLabel / Developer / Oberon / TextLabel.mod
Text File  |  1995-07-18  |  3KB  |  114 lines

  1. (*
  2. (*  $VER: TextLabel.mod 2.2 (18.7.95)
  3. **
  4. **  Interface definitions for BOOPSI textlabel image objects.
  5. **
  6. **  (c) Copyright 1994, 1995 hartmut Goebel.
  7. *)      All Rights Reserved.
  8. *)
  9.  
  10. MODULE TextLabel;
  11.  
  12. IMPORT
  13.   e := Exec,
  14.   I := Intuition,
  15.   u := Utility;
  16.  
  17. CONST
  18.   textLabelName * = "textlabel.image";
  19.  
  20.   (* Attributes *)
  21.   tlDummy     = u.user+50;
  22.   aUnderscore * = tlDummy + 1;
  23.         (* [IS...] (CHAR) - Character for determining the shortcut. *)
  24.  
  25.   aGadget     * = tlDummy + 2;
  26.         (* NEW for V2:
  27.          * [IS...] (Intuition.GadgetPtr) - be a label for this gadget.
  28.          * This is a mighty function, see class documentation for
  29.          * further information.
  30.          * You should at most specify one of TLA_Gadget and TLA_Image *)
  31.  
  32.   aAdjustment * = tlDummy + 3;
  33.         (* [IS...] (LONGSET) - Adjustment within the frame of
  34.          * IM_DRAWFRAME. Defaults to adjustCenter. *)
  35.  
  36.   aKey           * = tlDummy + 4;
  37.         (* [..G..] (CHAR) - Shortcut key of this label. *)
  38.  
  39.   aImage         * = tlDummy + 5;
  40.         (* NEW for V2:
  41.          * [IS...] (Intuition.ImagePtr) - be a label for this image.
  42.          * This is a mighty function, see class documentation for
  43.          * further information.
  44.          * You should at most specify one of TLA_Gadget and TLA_Image
  45.          *)
  46.  
  47.   aText       * = I.iaData;
  48.         (* [IS...] (Exec.STRPTR) - pointer to a null terminated
  49.          * array of character. *)
  50.  
  51.   aFont       * = I.iaFont;
  52.         (* [ISG..] (Graphics.TextFontPtr) - Font to be used for
  53.          * rendering the label strings.  Defaults to use
  54.          * DrawInfo.font. *)
  55.  
  56.   aDrawInfo   * = I.sysiaDrawInfo;
  57.         (* [IS...] (Intuition.DrawInfoPtr) - DrawInfoPtr for
  58.          * target screen. Required if aFont is ommitted. *)
  59.  
  60.   aMode       * = I.iaMode;
  61.         (* [IS...] (SHORTSET) - Drawing mode to use. *)
  62.  
  63.   aLeft       * = I.iaLeft;
  64.   aTop        * = I.iaTop;
  65.         (* [ISG..] (INTEGER) - left/top edge of image
  66.          * Specifying aGadget or aImage overwrites this attributes.
  67.          *)
  68.  
  69.   aWidth      * = I.iaWidth;
  70.   aHeight     * = I.iaHeight;
  71.         (* [..G..] (INTEGER) - dimensions of image
  72.          * filled in by the object *)
  73.  
  74.   aFGPen      * = I.iaFGPen;
  75.   aBGPen      * = I.iaBGPen;
  76.         (* [IS...] (SHORTINT) - Pen numbers to be used as foreground
  77.          * and background pens. Defaults to Intuition.blockPen and
  78.          * Intuition.backGroundPen. *)
  79.  
  80.  
  81.   (* values for aAdjustment *)
  82.   adjustCenter  * = LONGSET{ };
  83.  
  84.   adjustHCenter * = LONGSET{ };
  85.   adjustHLeft   * = LONGSET{0};
  86.   adjustHRight  * = LONGSET{1};
  87.  
  88.   adjustVCenter * = LONGSET{ };
  89.   adjustVTop    * = LONGSET{2};
  90.   adjustVBottom * = LONGSET{3};
  91.  
  92. TYPE
  93.   (* textlabel.image is an external class library.  OpenLibrary() returns
  94.    * a pointer to a struct ClassLibrary, from which you can obtain the class
  95.    * handle to create objects (textlabel.image is not a public class).
  96.    *)
  97.   ClassLibraryPtr  * = UNTRACED POINTER TO ClassLibrary;
  98.   ClassLibrary * = STRUCT (lib *: e.Library) (* Embedded library *)
  99.     pad     :  INTEGER;                      (* Align the structure *)
  100.     class - :  I.IClassPtr;                  (* Class pointer *)
  101.   END;
  102.  
  103. VAR
  104.   base *: ClassLibraryPtr;
  105.  
  106. BEGIN
  107.   base := e.OpenLibrary("images/textlabel.image",0);
  108.   IF base = NIL THEN HALT(20) END;
  109.  
  110. CLOSE
  111.   IF base # NIL THEN e.CloseLibrary(base); END;
  112.  
  113. END TextLabel.
  114.